﻿CREATE procedure [dbo].[spReportPTSPearlVarianceByGoc]
as
SELECT
	 LobParent as [Lob Parent]
	 , GOC as [System GOC]
	 , OTHead as [O&T Head]
	 , PTSLine as [PTS Line]
	 , PearlYTDAmount as [Pearl YTD Amount]
	 , PTSYTDAmount as [PTS YTD Amount]
	 , PearlYTDAmount - PTSYTDAmount as [Variance Pearl B/(W) PTS]
FROM vwPTSPearlReconciled
--WHERE GOC NOT IN (SELECT DISTINCT SystemGocCode FROM PearlAccountMapGocException)
--WHERE PTSLine NOT IN ('Labor Cost', 'Labor Cost, account sem mapeamento')
--AND (ISNULL(Pearl.YTDAmount, 0) <> 0 OR ISNULL(PTS.YTDAmount, 0) <> 0)
ORDER BY GOC